package edu.nf.admin.controller.admin;

import edu.nf.vo.ResultVO;

/***
 * 基类控制器
 */
public class BaseController {
    protected ResultVO success(){
        ResultVO vo = new ResultVO();
        vo.setCode(200);
        return vo;
    }

    protected ResultVO success(Object data){
        ResultVO vo = new ResultVO();
        vo.setCode(200);
        vo.setData(data);
        return vo;
    }

    protected ResultVO success(int code,String msg,Object data){
        return new ResultVO(code,msg,data);
    }

    protected ResultVO error(String msg){
        ResultVO vo = new ResultVO();
        vo.setMsg(msg);
        vo.setCode(500);
        return vo;
    }

    protected ResultVO error(int code,String msg,Object data){
        return new ResultVO(code,msg,data);
    }

}
